<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>地震局培训平台</title>
	<link rel="stylesheet" href="style/exam.css" />
</head>

<body>
	<div id="show">
		<div class="title"></div>
		<div class="list">
			<!-- <div class="title">基础测试（一）</div> -->
			<div class="tips">本套试卷共5个题目，每次考试随机抽取5个题目进行考试，每题20分，共100份。考试时间为5分钟。</div>
			<!-- <div class="box">
				<div class="question">1.地震发生时，你应该关闭家中的水电设施来降低灾害风险。一定要确保（
					<span></span> ）</div>
				<div class="radiobox">
					<div class="radio">A切断保险丝或跳闸 </div>
					<div class="radio">B关闭煤气阀门</div>
					<div class="radio">C关闭自来水阀门 </div>
				</div>
			</div> -->
			<!-- <div class="box">
				<div class="question">2.地震发生时，你应该关闭家中的水电设施来降低灾害风险。一定要确保（
					<span></span> ）</div>
				<div class="radiobox">
					<div class="radio">A切断保险丝或跳闸 </div>
					<div class="radio">B关闭煤气阀门</div>
					<div class="radio">C关闭自来水阀门 </div>
				</div>
			</div>
			<div class="box">
				<div class="question">3.地震发生时，你应该关闭家中的水电设施来降低灾害风险。一定要确保（
					<span></span> ）</div>
				<div class="radiobox">
					<div class="radio">A切断保险丝或跳闸 </div>
					<div class="radio">B关闭煤气阀门</div>
					<div class="radio">C关闭自来水阀门 </div>
				</div>
			</div>
			<div class="box">
				<div class="question">4.地震发生时，你应该关闭家中的水电设施来降低灾害风险。一定要确保（
					<span></span> ）</div>
				<div class="radiobox">
					<div class="radio">A切断保险丝或跳闸 </div>
					<div class="radio">B关闭煤气阀门</div>
					<div class="radio">C关闭自来水阀门 </div>
				</div>
			</div>
			<div class="box">
				<div class="question">5.地震发生时，你应该关闭家中的水电设施来降低灾害风险。一定要确保（
					<span></span> ）</div>
				<div class="radiobox">
					<div class="radio">A切断保险丝或跳闸 </div>
					<div class="radio">B关闭煤气阀门</div>
					<div class="radio">C关闭自来水阀门 </div>
				</div>
			</div> -->
		</div>
		<div class="submit"></div>
	</div>

	<script type="text/javascript" src="script/jquery.min.js"></script>
	<script type="text/javascript" src="script/ishoock.tools.js"></script>
	<script>
		$(function () {
			$(".radio").on("click", function () {
				$(this).parent(".radiobox").children().removeIn();
				$(this).in();
			});

			var loc = window.location.href;
			var n1 = loc.length;//地址的总长度
			var n2 = loc.indexOf("=");//取得=号的位置
			var id = decodeURI(loc.substr(n2 + 1, n1 - n2));//从=号后面的内容
			console.log(id);//

			$.ajax({
				type: "GET",
				url: "http://101.201.113.151:9230/traning/getQuestionByExamId/" + id,//访问的链接
				dataType: "json",  //数据格式设置为jsonp

				// jsonp:"callback",
				async: true,
				success: function (data) {  //成功的回调函数
					// alert(data.length);

					for (var i = 0; i < data.length; i++) {
						var item =
							'<div class="box">' +
							'<div class="question">' + (i + 1) + '.' + data[i].questionTitle + '<span class="spans">' + '（' + data[i].questionAnswer + '）' + '</span>' + '</div> ' +
							'<div class="radiobox">' +
							'<div class="radio">' + '<input type="radio" id="radio-1' + (i + 1) + '" name="radio-1-set' + (i + 1) + '" value="1' + (i + 1) + '"/>' + data[i].answers[0].selectName + data[i].answers[0].selectContent + '</div>' +
							'<div class="radio">' + '<input type="radio" id="radio-1' + (i + 1) + '" name="radio-1-set' + (i + 1) + '" value="2' + (i + 1) + '"/>' + data[i].answers[1].selectName + data[i].answers[1].selectContent + '</div>' +
							'<div class="radio">' + '<input type="radio" id="radio-1' + (i + 1) + '" name="radio-1-set' + (i + 1) + '" value="3' + (i + 1) + '"/>' + data[i].answers[2].selectName + data[i].answers[2].selectContent + '</div>' +
							'</div>' +
							'</div>';
						$(".list").append(item);

					}


				},
				error: function (e) {
				}
			});
			// $("#show .submit").on("click", function () {
			// 	$(".spans").css("color", "red", 'display', 'inline-block');
			// });
			$(document).on('click', '.submit', function () {
				$(".spans").css("opacity", "1");
				$(".spans").css("color", "red");
			})

		});
	</script>
</body>

</html>